package com.hgx.su.common.pure.dto;

import java.io.Serializable;
import java.util.List;

/**
 * Description: 通用分页dto
 * author: HGX
 * DateTime: 2021-02-05 9:17
 */
public class CommonPageResDto<T> implements Serializable {

    /**
     * 总记录数
     */
    protected Long total;
    /**
     * 结果集
     */
    protected List<T> list;
    /**
     * 当前页
     */
    private Integer pageNum;
    /**
     * 每页的数量
     */
    private Integer pageSize;
    /**
     * 当前页的数量
     */
    private Integer size;

    /**
     * 由于startRow和endRow不常用，这里说个具体的用法
     * 可以在页面中"显示startRow到endRow 共size条数据"
     * 当前页面第一个元素在数据库中的行号
     */
    private Integer startRow;

    /**
     * 当前页面最后一个元素在数据库中的行号
     */
    private Integer endRow;
    /**
     * 总页数
     */
    private Integer pages;

    /**
     * 前一页
     */
    private Integer prePage;
    /**
     * 下一页
     */
    private Integer nextPage;
    /**
     * 是否为第一页
     */
    private Boolean blnFirstPage;
    /**
     * 是否为最后一页
     */
    private Boolean blnLastPage;
    /**
     * 是否有前一页
     */
    private Boolean hasPreviousPage;
    /**
     * 是否有下一页
     */
    private Boolean hasNextPage;
    /**
     * 导航页码数
     */
    private Integer navigatePages;
    /**
     * 所有导航页号
     */
    private List<Integer> navigatePageNums;
    /**
     * 导航条上的第一页
     */
    private Integer navigateFirstPage;
    /**
     * 导航条上的最后一页
     */
    private Integer navigateLastPage;


    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public Integer getStartRow() {
        return startRow;
    }

    public void setStartRow(Integer startRow) {
        this.startRow = startRow;
    }

    public Integer getEndRow() {
        return endRow;
    }

    public void setEndRow(Integer endRow) {
        this.endRow = endRow;
    }

    public Integer getPages() {
        return pages;
    }

    public void setPages(Integer pages) {
        this.pages = pages;
    }

    public Integer getPrePage() {
        return prePage;
    }

    public void setPrePage(Integer prePage) {
        this.prePage = prePage;
    }

    public Integer getNextPage() {
        return nextPage;
    }

    public void setNextPage(Integer nextPage) {
        this.nextPage = nextPage;
    }

    public Boolean getBlnFirstPage() {
        return blnFirstPage;
    }

    public void setBlnFirstPage(Boolean blnFirstPage) {
        this.blnFirstPage = blnFirstPage;
    }

    public Boolean getBlnLastPage() {
        return blnLastPage;
    }

    public void setBlnLastPage(Boolean blnLastPage) {
        this.blnLastPage = blnLastPage;
    }

    public Boolean getHasPreviousPage() {
        return hasPreviousPage;
    }

    public void setHasPreviousPage(Boolean hasPreviousPage) {
        this.hasPreviousPage = hasPreviousPage;
    }

    public Boolean getHasNextPage() {
        return hasNextPage;
    }

    public void setHasNextPage(Boolean hasNextPage) {
        this.hasNextPage = hasNextPage;
    }

    public Integer getNavigatePages() {
        return navigatePages;
    }

    public void setNavigatePages(Integer navigatePages) {
        this.navigatePages = navigatePages;
    }

    public List<Integer> getNavigatePageNums() {
        return navigatePageNums;
    }

    public void setNavigatePageNums(List<Integer> navigatePageNums) {
        this.navigatePageNums = navigatePageNums;
    }

    public Integer getNavigateFirstPage() {
        return navigateFirstPage;
    }

    public void setNavigateFirstPage(Integer navigateFirstPage) {
        this.navigateFirstPage = navigateFirstPage;
    }

    public Integer getNavigateLastPage() {
        return navigateLastPage;
    }

    public void setNavigateLastPage(Integer navigateLastPage) {
        this.navigateLastPage = navigateLastPage;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("CommonPageDto{");
        sb.append("total=").append(total);
        sb.append(", list=").append(list);
        sb.append(", pageNum=").append(pageNum);
        sb.append(", pageSize=").append(pageSize);
        sb.append(", size=").append(size);
        sb.append(", startRow=").append(startRow);
        sb.append(", endRow=").append(endRow);
        sb.append(", pages=").append(pages);
        sb.append(", prePage=").append(prePage);
        sb.append(", nextPage=").append(nextPage);
        sb.append(", blnFirstPage=").append(blnFirstPage);
        sb.append(", blnLastPage=").append(blnLastPage);
        sb.append(", hasPreviousPage=").append(hasPreviousPage);
        sb.append(", hasNextPage=").append(hasNextPage);
        sb.append(", navigatePages=").append(navigatePages);
        sb.append(", navigatePageNums=").append(navigatePageNums);
        sb.append(", navigateFirstPage=").append(navigateFirstPage);
        sb.append(", navigateLastPage=").append(navigateLastPage);
        sb.append('}');
        return sb.toString();
    }
}
